package sheji.jieGou.zuHe;

import java.util.ArrayList;
import java.util.List;

//树枝节点类
public class ConcreteCompany implements Company {

    private final List<Company> companyList = new ArrayList<>();
    private final String name;// 姓名
    private final String position;// 职位
    private int salary;// 薪水

    // 构造函数
    public ConcreteCompany(String name, String position, int salary) {
        this.name = name;
        this.position = position;
        this.salary = salary;
    }

    public void add(Company company) {
        companyList.add(company);
    }

    public void remove(Company company) {
        companyList.remove(company);
    }

    public List<Company> getChild() {
        return companyList;
    }

    public String getInfo() {
        return "名称：" + name
                + "\t职位：" + position
                + "\t薪水: " + salary;
    }
}